package com.example.yls.demoa;

import android.animation.ValueAnimator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    private circleProgree myView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        myView=findViewById(R.id.my_view);
        int progress=myView.getProgress();
        ValueAnimator valueAnimator=ValueAnimator.ofInt(0,progress);
        valueAnimator.setDuration(5000);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                int value= (int) valueAnimator.getAnimatedValue();
                myView.setProgress(value);

            }
        });
        valueAnimator.start();
    }
}
